package com.lhwb.escsvinput.service;

import java.io.File;

import com.alibaba.excel.EasyExcel;
import com.alibaba.excel.ExcelReader;

import com.lhwb.escsvinput.vo.TmdbIndex;
import org.springframework.stereotype.Service;

@Service
public class ExcelService {

    public void readExcelAndImport() {

        TmdbReadExcelListener tmdbReadExcelListener = new TmdbReadExcelListener();

        ExcelReader excelReader = EasyExcel.read(new File("C:\\Users\\pc\\Documents\\workspace\\lean_buzhongyao"
            + "\\escsvimporter-main\\tmdb_5000_movies.csv")).head(TmdbIndex.class).registerReadListener(tmdbReadExcelListener).build();
        excelReader.readAll();
    }
}
